<?php
$servings=$recipe->servings;
$ingredients=$recipe->ingredients;
?>

<div><?php echo CHtml::encode($servings); ?></div>

<?php
if(empty($ingredients)) {
    echo CHtml::encode('无配料');
}
else {
    foreach($ingredients as $ingredient) {
?>
    <div>
        <span><?php echo CHtml::encode($ingredient->name); ?></span>
        <span><?php echo CHtml::encode($ingredient->quanlity); ?></span>
    </div>
<?php 
    } 
}
?>